
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author FFK
 */
public class Number {
    
    public int x;
    public int y;
    public Sprite num;
    public int array[] = new int[10];
    public rwBC docghi = new rwBC();
    public Number()
    {
        num=null;
        x=150;
        y=30;
        docghi.openRecStore();
            docghi.doc_sc();
            docghi.closeStore();
            for(int i = 0; i< 10 ; i++){
                array[i] = docghi.array_score[i];
            }
    }
    public void loadGraphics(Image image)
    {
        ImageLoader loader = ImageLoader.getInstance();
        num=new Sprite(image,15,10);
    }
    public void Render(Graphics g)
    {
        int n = 0;
        int tam_giatri = 0;
        for(int i =0; i< 10 ; i++){
            if(array[i] != 0){
//                n = array[i];
//                while(n != 0){
//                    tam_giatri = n % 10;
//                    n = n / 10;
//                    x = x - 20;
//                    num.setFrame(tam_giatri);
//                    num.setPosition(x, y);
//                    num.paint(g);
//                    if(n == 0){
//                        x =200;
//                        y = y+20;
//                        tam_giatri = 0;
//                    }
//                }
                g.setColor(5);
                g.drawString(Integer.toString(array[i]), x, y, 0);
                y = y+20;
            }
            
        }
        x = 200;
        y = 50;
         
    }
}
